package com.hhs.storage.controller;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.hhs.storage.bean.*;
import com.hhs.storage.service.JxcMenuService;
import com.hhs.storage.service.UserService;
import com.hhs.storage.service.YymUserExtService;
import com.hhs.storage.util.QRCodeUtil;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/app/rwm")
public class AppMyRWController {
    @RequestMapping(value = "gen")
    public Map<String,Object> generate(HttpServletRequest request,String userid) throws Exception{
        String uri=request.getRequestURI();
        String url=request.getRequestURL().toString();
        String basepath=url.substring(0,url.indexOf(uri));
        String text = basepath+"/login.html?tjcode="+userid;
        QRCodeUtil.encode(text, "", "/upload/"+userid, true);
        return Result.sucJsonResp(null);
    }
}
